package org.dromara.learning_lhz.controller;

import org.dromara.learning_lhz.entity.AsFormativeTestEntity;
import org.dromara.learning_lhz.entity.AsStudyEntity;
import org.dromara.learning_lhz.service.FormativeTestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 阶段测试
 */
@RestController
@RequestMapping("/formative")
public class FormativeTestController {

    @Autowired
    private FormativeTestService formativeTestService;


    /**
     * 根据条件查询试卷
     * @param asFormativeTestEntity
     * @return
     */
    @PostMapping("selFormative")
    public List<AsFormativeTestEntity> selFormative(@RequestBody AsFormativeTestEntity asFormativeTestEntity) {
        return formativeTestService.selFormative(asFormativeTestEntity);
    }

    /**
     * 添加试卷
     * @param asFormativeTestEntity
     * @return
     */
    @PostMapping("addFormative")
    public void addFormative(@RequestBody AsFormativeTestEntity asFormativeTestEntity) {
        formativeTestService.addFormative(asFormativeTestEntity);
    }
    /**
     * 修改试卷
     * @param asFormativeTestEntity
     * @return
     */
    @PostMapping("updateFormative")
    public void updateFormative(@RequestBody AsFormativeTestEntity asFormativeTestEntity) {
        formativeTestService.updateById(asFormativeTestEntity);
    }

    /**
     * 删除试卷
     * @param asFormativeTestEntity
     * @return
     */
    @PostMapping("delStudy")
    public void delStudy(@RequestBody AsFormativeTestEntity asFormativeTestEntity) {
        formativeTestService.removeById(asFormativeTestEntity);
    }





}
